/**
 * Project: topdt-jbpm
 * Copyright 2013  Top Digital Technology  Co. Ltd.
 * All right reserved.
 */
package com.topdt.jbpm.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

import com.topdt.jbpm.identity.User;

/**
 * 建立日期 : 2013-4-25 下午12:03:54<br>
 * 作者 : balance<br>
 * 模块 : <br>
 * 描述 : <br>
 * 修改历史: 序号 日期 修改人 修改原因 <br>
 * 1 <br>
 * 2 <br>
 */
@Entity
@Table(name = "wf_todo")
public class Todo extends JbpmModel {

	private static final long serialVersionUID = 1L;
	public static final String STATE_READY = "ready";// 现成的，可以直接处理了
	public static final String STATE_COMPETITIVE = "competitive";// 竞争的
	public static final String STATE_FINISHED = "finished";// 完成
	public static final String STATE_BACK = "backed";// 退回成功
	public static final String MODE_SINGLE = "single";// 单人
	public static final String MODE_UNIQUE = "unique";// 多人唯一
	public static final String MODE_SEQUENCE = "sequence";// 多人顺序
	public static final String MODE_CONCURRENCE = "concurrence";// 多人并发
	
	@Id
	@GeneratedValue(generator = "generator")
	@GenericGenerator(name = "generator", strategy = "uuid")
	@Column(length = 32)
	private String todoId;
	private String todoTitle;//待办标题
	private String taskId;//jbpm的taskId
	private String fromUserId;//从哪个人提交上来的id
	private String toUserId;
	private String workId;//工作ID
	@Transient
	private User fromUser;
	public User getFromUser() {
		return fromUser;
	}

	public void setFromUser(User fromUser) {
		this.fromUser = fromUser;
	}

	@Transient
	private User toUser; 
	@Transient
	private Work work;
	private Date arriveTime;//达到时间
	private String activityName;//环节名称
	private String destActivityName;// 目的环节名称
	private String state;//状态
	private String appName;//应用名
	private String preActivityName;//上一个环节名称
	private long batch;// 批次
	@Column(name = "SEQ_NUM")
	private int seqNUM;// 排序
	private String todoMode;// 待办模式:多人唯一、多人顺序、多人并行、单人
	private String isSend; //记录是否发送过短信，‘1’表示已发送，‘’表示未发送
	@Transient
	private String todoType; //表单（ticket）或公文（document）
	
	public Todo(){
		
	}
	
	public Todo(String todoId, String todoTitle, String taskId,String fromUserId, 
			String toUserId, String workId, Date arriveTime,String activityName, 
			String destActivityName, String state,String appName, String preActivityName, 
			Long batch, int seqNUM,String todoMode, String isSend, 
			String companyId) {
		super();
		this.todoId = todoId;
		this.todoTitle = todoTitle;
		this.taskId = taskId;
		this.fromUserId = fromUserId;
		this.toUserId = toUserId;
		this.workId = workId;
		this.arriveTime = arriveTime;
		this.activityName = activityName;
		this.destActivityName = destActivityName;
		this.state = state;
		this.appName = appName;
		this.preActivityName = preActivityName;
		this.batch = batch;
		this.seqNUM = seqNUM;
		this.todoMode = todoMode;
		this.isSend = isSend;
		this.companyId = companyId;
	}


	public String getDestActivityName() {
		return destActivityName;
	}

	public void setDestActivityName(String destActivityName) {
		this.destActivityName = destActivityName;
	}

	public int getSeqNUM() {
		return seqNUM;
	}

	public void setSeqNUM(int seqNUM) {
		this.seqNUM = seqNUM;
	}

	public String getTodoMode() {
		return todoMode;
	}

	public void setTodoMode(String todoMode) {
		this.todoMode = todoMode;
	}

	public long getBatch() {
		return batch;
	}

	public void setBatch(long batch) {
		this.batch = batch;
	}

	public String getActivityName() {
		return activityName;
	}

	public void setActivityName(String activityName) {
		this.activityName = activityName;
	}

	public String getTaskId() {
		return taskId;
	}

	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}

	public String getTodoTitle() {
		return todoTitle;
	}

	public void setTodoTitle(String todoTitle) {
		this.todoTitle = todoTitle;
	}

	public String getTodoId() {
		return todoId;
	}

	public void setTodoId(String todoId) {
		this.todoId = todoId;
	}

	public String getToUserId() {
		return toUserId;
	}

	public void setToUserId(String toUserId) {
		this.toUserId = toUserId;
	}

	public User getToUser() {
		return toUser;
	}

	public void setToUser(User toUser) {
		this.toUser = toUser;
	}

	public String getFromUserId() {
		return fromUserId;
	}

	public void setFromUserId(String fromUserId) {
		this.fromUserId = fromUserId;
	}

	public User getFormUser() {
		return fromUser;
	}

	public void setFormUser(User formUser) {
		this.fromUser = formUser;
	}

	public Work getWork() {
		return work;
	}

	public void setWork(Work work) {
		this.work = work;
	}

	public Date getArriveTime() {
		return arriveTime;
	}

	public void setArriveTime(Date arriveTime) {
		this.arriveTime = arriveTime;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getWorkId() {
		return workId;
	}

	public void setWorkId(String workId) {
		this.workId = workId;
	}

	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public String getPreActivityName() {
		return preActivityName;
	}

	public void setPreActivityName(String preActivityName) {
		this.preActivityName = preActivityName;
	}

	public String getIsSend() {
		return isSend;
	}

	public void setIsSend(String isSend) {
		this.isSend = isSend;
	}

	public String getTodoType() {
		return todoType;
	}

	public void setTodoType(String todoType) {
		this.todoType = todoType;
	}


/*	public TodoVar creatVar(String key,String val) {
		TodoVar var = new TodoVar();
		var.setWorkId(workId);
		var.setCompanyId(companyId);
		var.setTodoId(todoId);
		var.setInsertTime(new Date());
		var.setVarType(key);
		var.setTextVal(val);
		return var;
	}*/

}
